#ifndef __STDTHREAD_H_
#define __STDTHREAD_H_


struct StdThread;
typedef struct StdThread Thread;

Thread *InitThread(void* (*funcPtr)(void *),void *arg);
//线程等待
void* ThreadJoin(Thread *t);
void ThreadDetach(Thread *t);
void ThreadCancel(Thread *t);
unsigned long int GetThreadId(Thread *t);
void ClearThread(void *t);

//返回当前线程的进程号
unsigned long int GetSelfThrdID();


struct StdMutex;
typedef struct StdMutex Mutex;

Mutex *InitMutex();
void MutexLock(Mutex *m);
void MutexUnlock(Mutex *m);
void ClearMutex(Mutex *m);

struct StdCond;
typedef struct StdCond Cond;

Cond *InitCond();
void CondWait(Cond *c,Mutex *m);
void CondSignal(Cond *c);
void CondBroadcast(Cond *c);
void ClearCond(Cond *c);

#endif